package com.xujiang.myblog.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

/**
 * Created by xujiang on 2017/4/12.
 */

public class MyPagerAdapter extends FragmentStatePagerAdapter {

    private  Fragment[] fragments;

    public MyPagerAdapter(FragmentManager fm,Fragment[] fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments[position];
    }

    @Override
    public int getCount() {
        return fragments.length;
    }
}
